﻿using System;
using System.Collections.Generic;

using System.Text;

namespace System.Qizx.Xml
{
    /*******************************/
    /// <summary>
    /// This class provides the base implementation for the management of XML documents parsing.
    /// </summary>
    public class XmlSaxParserAdapter : XmlSAXDocumentManager, XmlSaxContentHandler
    {

        /// <summary>
        /// This method manage the notification when Characters element were found.
        /// </summary>
        /// <param name="ch">The array with the characters founds</param>
        /// <param name="start">The index of the first position of the characters found</param>
        /// <param name="length">Specify how many characters must be read from the array</param>
        public virtual void characters(char[] ch, int start, int length) { }

        /// <summary>
        /// This method manage the notification when the end document node were found
        /// </summary>
        public virtual void endDocument() { }

        /// <summary>
        /// This method manage the notification when the end element node were found
        /// </summary>
        /// <param name="namespaceURI">The namespace URI of the element</param>
        /// <param name="localName">The local name of the element</param>
        /// <param name="qName">The long name (qualify name) of the element</param>
        public virtual void endElement(string namespaceURI, string localName, string qName) { }

        /// <summary>
        /// This method manage the event when an area of expecific URI prefix was ended.
        /// </summary>
        /// <param name="prefix">The prefix that ends.</param>
        public virtual void endPrefixMapping(string prefix) { }

        /// <summary>
        /// This method manage the event when a ignorable whitespace node were found
        /// </summary>
        /// <param name="ch">The array with the ignorable whitespaces</param>
        /// <param name="start">The index in the array with the ignorable whitespace</param>
        /// <param name="length">The length of the whitespaces</param>
        public virtual void ignorableWhitespace(char[] ch, int start, int length) { }

        /// <summary>
        /// This method manage the event when a processing instruction were found
        /// </summary>
        /// <param name="target">The processing instruction target</param>
        /// <param name="data">The processing instruction data</param>
        public virtual void processingInstruction(string target, string data) { }

        /// <summary>
        /// Receive an object for locating the origin of events into the XML document
        /// </summary>
        /// <param name="locator">A 'XmlSaxLocator' object that can return the location of any events into the XML document</param>
        public virtual void setDocumentLocator(XmlSaxLocator locator) { }

        /// <summary>
        /// This method manage the event when a skipped entity was found.
        /// </summary>
        /// <param name="name">The name of the skipped entity.</param>
        public virtual void skippedEntity(string name) { }

        /// <summary>
        /// This method manage the event when a start document node were found 
        /// </summary>
        public virtual void startDocument() { }

        /// <summary>
        /// This method manage the event when a start element node were found
        /// </summary>
        /// <param name="namespaceURI">The namespace uri of the element tag</param>
        /// <param name="localName">The local name of the element</param>
        /// <param name="qName">The Qualify (long) name of the element</param>
        /// <param name="qAtts">The list of attributes of the element</param>
        public virtual void startElement(string namespaceURI, string localName, string qName, SaxAttributesSupport qAtts) { }

        /// <summary>
        /// This methods indicates the start of a prefix area in the XML document.
        /// </summary>
        /// <param name="prefix">The prefix of the area.</param>
        /// <param name="uri">The namespace URI of the prefix area.</param>
        public virtual void startPrefixMapping(string prefix, string uri) { }

    }
}
